<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>结构伪类选择器2</title>
        <style>
            li:first-child{text-decoration: underline;}
            li:last-child{text-decoration: line-through;}
            li:nth-child(2n){background-color: red;}
            li:nth-child(2n+1){background-color: green;}
            li:only-child{background-color: blue;}
            h2:nth-of-type(1){color:red;}
            h2:nth-last-of-type(2){color:green;}
        </style>
    </head>
    <body>
        <h2>贺岁喜剧电影</h2>
        <ul>
            <li>大闹天竺</li>
            <li>我说的都是真的</li>
            <li>老师也疯狂</li>
            <li>欢乐喜剧人</li>
            <li>决战食神</li>
            <li>摆渡人</li>
        </ul>
        <h2>贺岁儿童动画片</h2>
        <ul>
            <li>熊出没</li>
        </ul>
        <h2>贺岁动作电影</h2>
    </body>
</html>